package com.itheima.reggie.service;

import com.itheima.reggie.entity.ShoppingCart;

import java.util.List;

/**
 * @author 黑马程序员
 */
public interface ShoppingCartService {

    /**
     * 添加购物车
     * @param shoppingCart 购物车当前产品数据
     * @param id 用户的id
     * @return ShoppingCart
     */
    ShoppingCart add(ShoppingCart shoppingCart, Long id);

    /**
     * 获取用户的购物车集合
     * @param uid 用户id
     * @return List
     */
    List<ShoppingCart> findAllByUid(Long uid);

    /**
     * 根据用户id删除购物车数据
     * @param uid
     */
    void clean(Long uid);

    void sub(ShoppingCart shoppingCart);
}
